package com.hsxxherp.ation.oauth2.center.server.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author Baomidou
 * @since 2024-06-15
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("uaa_client")
public class UaaClient implements Serializable {

    public static final String PK_CLIENT = "pk_client";
    public static final String CLIENT_ID = "client_id";
    public static final String CLIENT_NAME = "client_name";
    public static final String CLIENT_SECRET = "client_secret";
    public static final String STATE = "state";
    private static final long serialVersionUID = 1L;
    /**
     * client主键
     */
    @TableId(value = "pk_client", type = IdType.ASSIGN_ID)
    private String pkClient;
    @TableField("client_id")
    private String clientId;
    @TableField("client_name")
    private String clientName;
    @TableField("client_secret")
    private String clientSecret;
    @TableField("state")
    private State state;

    @Getter
    public static enum State {
        ENABLED(1, "启用");
        @EnumValue
        int code;
        @JsonValue
        String name;

        private State(int code, String name) {
            this.code = code;
            this.name = name;
        }
    }
}
